﻿@model ConferenceMasterModel
<script>
	$(function () {
		if (undefined != $("#focus")) {
			var sWidth = $("#focus").width(); //获取焦点图的宽度（显示面积）
			var len = $("#focus ul li").length; //获取焦点图个数
			var index = 0;
			var picTimer;

			//以下代码添加数字按钮和按钮后的半透明条，还有上一页、下一页两个按钮
			var btn = "<div class='btnBg'></div><div class='btn'>";
			for (var index = 0; index < len; index++) {
				var num = index + 1
				btn += "<span style='color:white'>" + "<p style='color:#000'>" + num + "</p>" + "</span>";
			}
			btn += "</div><div class='preNext pre'></div><div class='preNext next'></div>";
			$("#focus").append(btn);
			$("#focus").append('<div class="num">' + '</div>');

			//为小按钮添加鼠标滑入事件，以显示相应的内容
			$("#focus .btn span").css("opacity", 0.4).mouseenter(function () {
				index = $("#focus .btn span").index(this);
				showPics(index);
			}).eq(0).trigger("mouseenter");

			//上一页、下一页按钮透明度处理
			$("#focus .preNext").css("opacity", 0.2).hover(function () {
				$(this).stop(true, false).animate({ "opacity": "0.5" }, 100);
			}, function () {
				$(this).stop(true, false).animate({ "opacity": "0.2" }, 300);
			});

			//上一页按钮
			$("#focus .pre").click(function () {
				index -= 1;
				if (index == -1) { index = len - 1; }
				showPics(index);
			});

			//下一页按钮
			$("#focus .next").click(function () {
				index += 1;
				if (index == len) { index = 0; }
				showPics(index);
			});

			//本例为左右滚动，即所有li元素都是在同一排向左浮动，所以这里需要计算出外围ul元素的宽度
			$("#focus ul").css("width", sWidth * (len));

			//鼠标滑上焦点图时停止自动播放，滑出时开始自动播放
			$("#focus").hover(function () {
				clearInterval(picTimer);
			}, function () {
				picTimer = setInterval(function () {
					showPics(index);
					index++;
					if (index == len) { index = 0; }
				}, 5000); //此4000代表自动播放的间隔，单位：毫秒
			}).trigger("mouseleave");

			//显示图片函数，根据接收的index值显示相应的内容
			function showPics(index) { //普通切换
				var nowLeft = -index * sWidth; //根据index值计算ul元素的left值
				$("#focus ul").stop(true, false).animate({ "left": nowLeft }, 300); //通过animate()调整ul元素滚动到计算出的position
				$("#focus .btn span").stop(true, false).animate({ "opacity": "0.4" }, 300).eq(index).stop(true, false).animate({ "opacity": "1" }, 300); //为当前的按钮切换到选中的效果
			}
		}

		//Top
		var id = "@Model.Id";
		var curl = "@Url.Action(nameof(UtilityController.GetConferenceData), nameof(UtilityController).GetControllerName())" + "/" + id;
		$.get(curl, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxSuccessResult") {
				if ("@Model.IsShowCountdown" == "True") {
					$("#m-time").html("")
					if (!data.data.allowEntry) {
						if (data.data.betweenDays < 0) {
							$("#m-time").append('<p><span>@Resources.ConferenceIsFinish</span></p>')
						} else if (data.data.betweenDays >= 0) {
							var topMessage = "@Resources.FromNowToStartday";
							if ("@Model.IsInternational" == "True") {
								if (data.data.betweenDays < 10) {
									topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -51px;top: 7px;">' + data.data.betweenDays + '</span>');
								}
								else if (data.data.betweenDays < 100 && data.data.betweenDays > 9) {
									topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -60px;top: 7px;">' + data.data.betweenDays + '</span>');
								}
								else {
									topMessage = topMessage.replace(/\{0\}/g, '<span style="position: absolute;left: -71px;top: 7px;">' + data.data.betweenDays + '</span>');
								}
								$("#m-time").append('<p style="text-align: left;width: 200px;position: relative;left: 67px;line-height: 18px; top: 4px; font-size:16px">' + topMessage + '</p>')
							} else {
								topMessage = topMessage.replace(/\{0\}/g, "<span>" + data.data.betweenDays + "</span>");
								$("#m-time").append("<p>" + topMessage + "</p>")
							}
						}
					} else {
						$("#m-time").append("<p><span>@Resources.MsgConferenceIsOperating</span></p>")
					}
				} else {
					$("#m-time").css("display", "none");
				}

				@if (User == null) {
					<text>
					$("#m-rButton").attr("onclick", "$(window.location).attr('href', '/Account/Login');");
					$("#m-cButton").attr("onclick", "$(window.location).attr('href', '/Account/Login');");
					$("#m-hButton").attr("onclick", "$(window.location).attr('href', '/Account/Login');");
					</text>
				} else {
					<text>
					$("#m-rButton").attr("onclick", "top.location.href='@ConstValues.SystemWeb/MeetingAttendence/Index?conferenceId=@Model.Id'");
					$("#m-cButton").attr("onclick", "top.location.href='@ConstValues.SystemWeb/MeetingContribute/Index?conferenceId=@Model.Id'");
					$("#m-hButton").attr("onclick", "top.location.href='@ConstValues.SystemWeb/MeetingBooking/Index?conferenceId=@Model.Id'");
					</text>
				}

				if (!data.data.allowRegister || !data.data.hasRegister) {
					$("#m-rButton").css("background", "#d4d4d4")
					$("#m-rButton").css("cursor", "default")
					$("#m-rButton").attr("diabled", true)
					$("#m-rButton").removeAttr("onclick")
				} else {
					@if (!string.IsNullOrEmpty(Model.ColorForConference)) {
						<text>
						background.setBackgroundAndOpacity($("#m-rButton"), "@Model.ColorForConference", 1);
						$("#m-rButton").hover(function () {
							background.setBackgroundAndOpacity($("#m-rButton"), "@Model.ColorForConference", 0.5);
						}, function () {
							background.setBackgroundAndOpacity($("#m-rButton"), "@Model.ColorForConference", 1);
						});
						</text>
					}
				}

				if (!data.data.allowContribute || !data.data.hasContribute) {
					$("#m-cButton").css("background", "#d4d4d4")
					$("#m-cButton").css("cursor", "default")
					$("#m-cButton").attr("diabled", true)
					$("#m-cButton").removeAttr("onclick")
				} else {
					@if (!string.IsNullOrEmpty(Model.ColorForConference)) {
						<text>
						background.setBackgroundAndOpacity($("#m-cButton"), "@Model.ColorForConference", 1);
						$("#m-cButton").hover(function () {
							background.setBackgroundAndOpacity($("#m-cButton"), "@Model.ColorForConference", 0.5);
						}, function () {
							background.setBackgroundAndOpacity($("#m-cButton"), "@Model.ColorForConference", 1);
						});
						</text>
					}
				}

				var type = 0;
				var span = "";
				if (data.data.allowHotel && data.data.allowTraffic) {
					type = 1;
					span = "@Resources.MenuHotelTraffic";
				} else if (data.data.allowHotel) {
					type = 2;
					span = "@Resources.Hotel";
				} else if (data.data.allowTraffic) {
					type = 3;
					span = "@Resources.Traffic";
				} else {
					$("#m-hButton").hide()
				}
				$("#m-hButton").val(span)

				if (!data.data.allowRegister) {
					$("#m-hButton").css("background", "#d4d4d4")
					$("#m-hButton").css("cursor", "default")
					$("#m-hButton").attr("diabled", true)
					$("#m-hButton").removeAttr("onclick")
				} else if (type == 1 && !data.data.hasHotel && !data.data.hasTraffic) {
					$("#m-hButton").css("background", "#d4d4d4")
					$("#m-hButton").css("cursor", "default")
					$("#m-hButton").attr("diabled", true)
					$("#m-hButton").removeAttr("onclick")
				} else if (type == 2 && !data.data.hasHotel) {
					$("#m-hButton").css("background", "#d4d4d4")
					$("#m-hButton").css("cursor", "default")
					$("#m-hButton").attr("diabled", true)
					$("#m-hButton").removeAttr("onclick")
				} else if (type == 3 && !data.data.hasTraffic) {
					$("#m-hButton").css("background", "#d4d4d4")
					$("#m-hButton").css("cursor", "default")
					$("#m-hButton").attr("diabled", true)
					$("#m-hButton").removeAttr("onclick")
				} else {
					@if (!string.IsNullOrEmpty(Model.ColorForConference)) {
						<text>
						background.setBackgroundAndOpacity($("#m-hButton"), "@Model.ColorForConference", 1);
						$("#m-hButton").hover(function () {
							background.setBackgroundAndOpacity($("#m-hButton"), "@Model.ColorForConference", 0.5);
						}, function () {
							background.setBackgroundAndOpacity($("#m-hButton"), "@Model.ColorForConference", 1);
						});
						</text>
					}
				}
			}
		});

		var menuFontColor = "#ffffff";
		@if (!string.IsNullOrEmpty(Model.FontColorForMenu)) {
			<text>
			menuFontColor = "@Model.FontColorForMenu"
			</text>
		}

		//Menu
		$("#m-menu").html("");
		var m_url = "@Url.Action(nameof(UtilityController.GetLevelOneMenu),
				nameof(UtilityController).GetControllerName())" + "/" + "@Model.Id";
		$.get(m_url, null, function (data, textStatus, jqXHR) {
			if (data.length > 0) {
				var len = 0
				for (var index = 0; index < data.length; index++) {
					var mId = data[index].id
					var html = ""
					if (data[index].link != "") {
						html = '<li class="l1" id="li_' + mId + '"><a id="menu_' + mId + '" href="' + data[index].link + '" target="_blank" style="color:' + menuFontColor + '">' + data[index].menuName + '</a>'
							+ '<div class="hid"><ul id="menu2' + mId + '"></ul></div></li>'
					} else {
						html = '<li class="l1" id="li_' + mId + '"><span id="menu_' + mId + '" style="color:' + menuFontColor + '">' + data[index].menuName + '</span>'
							+ '<div class="hid"><ul id="menu2' + mId + '"></ul></div></li>'
					}
					$("#m-menu").append(html)
					len += $("#li_" + mId).innerWidth();

					$("#menu2" + mId).html("")
					var m2_url = "@Url.Action(nameof(UtilityController.GetLevelTwoMenu),
						nameof(UtilityController).GetControllerName())?id=" + "@Model.Id" + "&menuId=" + mId;
					$.get(m2_url, null, function (tdata, textStatus, jqXHR) {
						if (tdata.length > 0) {
							for (var subindex = 0; subindex < tdata.length; subindex++) {
								var mhtml = ""
								if (tdata[subindex].link != "") {
									mhtml = '<li class="l2"><a id="submenu_' + subindex + '" href="' + tdata[subindex].link + '" target="_blank" style="color:' + menuFontColor + '">' + tdata[subindex].menuName + '</a></li>'
								} else {
									mhtml = '<li class="l2"><span id="submenu_' + subindex + '" style="color:' + menuFontColor + '">' + tdata[subindex].menuName + '</span></li>'
								}
								$("#menu2" + tdata[subindex].menuId).append(mhtml)
							}
						}
					});
				}

				background.setOnResize();

				@if (!string.IsNullOrEmpty(Model.ColorForMenu)) {
					<text>
					background.setBackgroundAndOpacity($(".top"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu"));
					$(".l1").hover(function () {
						background.setBackgroundAndOpacity(this, "@Model.ColorForMenu", 0.9 - Number("@Model.OpacityOfMenu"));
						background.setBackgroundAndOpacity($(".hid"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu") * (0.1 + Number("@Model.OpacityOfMenu")));

						$(".l2 a").hover(function () {
							jQuery(this).css({ "text-decoration": "underline" });
						}, function () {
							jQuery(this).css({ "text-decoration": "none" });
						});
					}, function () {
						background.setBackgroundAndOpacity($(this), "@Model.ColorForMenu", 0);
					});
					</text>
				} else {
					<text>
					background.setBackgroundAndOpacity($(".top"), "#4c4948", 1);
					$(".l1").hover(function () {
						background.setBackgroundAndOpacity(this, "#6c6b6a", 1);
						background.setBackgroundAndOpacity($(".hid"), "#6c6b6a", 1);
						$(".l2 a").hover(function () {
							jQuery(this).css({ "text-decoration": "underline" });
						}, function () {
							jQuery(this).css({ "text-decoration": "none" });
						});
					}, function () {
						background.setBackgroundAndOpacity(this, "#4c4948", 1);
					});
					</text>
				}
			}
		});

		//NewsList Right
		$("#rightNewsList").html("");
		var r_url = "@Url.Action(nameof(MeetingMainController.GetRightNewsList),
				nameof(MeetingMainController).GetControllerName())" + "/" + "@Model.Id";
		$.get(r_url, null, function (data, textStatus, jqXHR) {
			if (data.length > 0) {
				for (var r = 0; r < data.length; r++) {
					var html = '<div class="box" id="b' + data[r].id + '">'
						+ '<div class="tit">'
						+ '<div class="ft">'
						+ '<div class="l" id="l' + data[r].id + '" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">' + data[r].newsListName + '</div>'
						+ '<div class="r" id="r' + data[r].id + '"><a id="a' + data[r].id + '">more&raquo;</a></div>'
						+ '</div>'
						+ '<div class="ln"><span class="c1" id="c' + data[r].id + '" ></span><span class="c2"></span></div>'
						+ '<div class="clear"></div>'
						+ '</div>'
						+ '<div id="rlist' + data[r].id + '" class="txt02">'
						+ '<ul id="rightNews' + data[r].id + '">'
						+ '</ul>'
						+ '</div>'
						+ '</div>'

					$("#rightNewsList").append(html)

					if (data[r].backgroundColor != null && data[r].backgroundColor != "") {
						background.setBackgroundAndOpacity($("#b" + data[r].id), data[r].backgroundColor, 1 - Number(data[r].backgroundOpacity));
					} else {
						background.setBackgroundAndOpacity($("#b" + data[r].id), "#ffffff", 0);
					}

					$("#l" + data[r].id).css({
						"font-size": data[r].fontSize,
						"font-weight": data[r].fontWeight,
						"font-style": data[r].fontStyle,
						"color": data[r].fontColor
					});

					if (data[r].isShowMore == false) {
						$("#r" + data[r].id).css("display", "none");
					}

					if (data[r].moreColor != null && data[r].moreColor != "") {
						$("#a" + data[r].id).css("color", data[r].moreColor);
					} else {
						$("#a" + data[r].id).css("color", "#8f8f8f");
					}

					if (data[r].lineColor != null && data[r].lineColor != "") {
						$("#c" + data[r].id).css("background", data[r].lineColor);
					} else {
						$("#c" + data[r].id).css("background", "#c30d23");
					}

					$("#a" + data[r].id).attr("href", "@Url.Action(nameof(MeetingNewsListController.Index), nameof(MeetingNewsListController).GetControllerName())" + "/" + data[r].id)
					$("#a" + data[r].id).attr("target", "_blank")

					$("#rightNews" + data[r].id).html("")

					var r2_url = "@Url.Action(nameof(UtilityController.GetNews),
					nameof(UtilityController).GetControllerName())?id=" + "@Model.Id" + "&newslistId=" + data[r].id;
					$.get(r2_url, null, function (rdata, textStatus, jqXHR) {
						if (rdata.length > 0) {
							for (var k = 0; k < rdata.length; k++) {
								if (k <= 4) {
									var rightNewsId = rdata[k].id;
									var rightNewsListId = rdata[k].newsListId;

									//图+标+时间+摘要
									var ptad_rightHtml = '<li><a id="ptad_right' + rightNewsId + '">'
									+ '<p><img style="width:200px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + rightNewsId + '" /></p>'
									+ '<p>' + rdata[k].newsTitle + '</p>'
									+ '<p>' + rdata[k].abstract + '</p>'
									+ '<p style="color:#b4b4b4">' + rdata[k].createDate + '</p>'
									+ '</a></li>'

									//图+标题
									var pt_rightHtml = '<li><a id="pt_right' + rightNewsId + '">'
									+ '<p><img style="width:200px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + rightNewsId + '" /></p>'
									+ '<p>' + rdata[k].newsTitle + '</p>'
									+ '</a></li>'

									//图
									var p_rightHtml = '<li><a id="p_right' + rightNewsId + '">'
									+ '<p><img style="width:200px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + rightNewsId + '" /></p>'
									+ '</a></li>'

									//标题+时间
									var tt_rightHtml = '<li><a id="tt_right' + rightNewsId + '" >' + rdata[k].newsTitle + '<span style="float:right; color:#b4b4b4">' + rdata[k].createDate + '</span></a></li>'

									//标题
									var t_rightHtml = '<li><a id="t_right' + rightNewsId + '">' + rdata[k].newsTitle + '</a></li>'

									//正文
									var s_rightHtml = '<li><span id="s_right' + rightNewsId + '" style="word-break:break-all; width:150px;">' + rdata[k].mainText + '</span></li>'

									var newsStyle = rdata[k].newsStyle

									if (newsStyle == "@ConstValues.NewsStyle.图标时摘") {
										$("#rightNews" + rightNewsListId).append(ptad_rightHtml)
										$("#ptad_right" + rightNewsId).attr("href", rdata[k].link)
										$("#ptad_right" + rightNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图标") {
										$("#rightNews" + rightNewsListId).append(pt_rightHtml)
										$("#pt_right" + rightNewsId).attr("href", rdata[k].link)
										$("#pt_right" + rightNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图") {
										$("#rightNews" + rightNewsListId).append(p_rightHtml)
										$("#p_right" + rightNewsId).attr("href", rdata[k].link)
										$("#p_right" + rightNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标时") {
										$("#rightNews" + rightNewsListId).append(tt_rightHtml)
										$("#rlist" + rightNewsListId).removeClass("txt02").addClass("txt")
										$("#tt_right" + rightNewsId).attr("href", rdata[k].link)
										$("#tt_right" + rightNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标") {
										$("#rightNews" + rightNewsListId).append(t_rightHtml)
										$("#rlist" + rightNewsListId).removeClass("txt02").addClass("txt")
										$("#t_right" + rightNewsId).attr("href", rdata[k].link)
										$("#t_right" + rightNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.正文") {
										$("#rightNews" + rightNewsListId).append(s_rightHtml)
										$("#rlist" + rightNewsListId).removeClass("txt02").addClass("txt04")
									} else {
										console.log("newsStyle有问题")
									}
								}
							}
						}
					});
				}
			}
		});

		//NewsList Mid
		$("#centerNewsList").html("");
		var n_url = "@Url.Action(nameof(MeetingMainController.GetCenterNewsList),
				nameof(MeetingMainController).GetControllerName())" + "/" + "@Model.Id";
		$.get(n_url, null, function (data, textStatus, jqXHR) {
			if (data.length > 0) {
				for (var nindex = 0; nindex < data.length; nindex++) {
					var html = '<div class="box fl" id="b' + data[nindex].id + '">'
						+ '<div class="tit">'
						+ '<div class="ft">'
						+ '<div class="l" id="l' + data[nindex].id + '">' + data[nindex].newsListName + '</div>'
						+ '<div class="r" id="r' + data[nindex].id + '"><a id="a' + data[nindex].id + '">more&raquo;</a></div>'
						+ '</div>'
						+ '<div class="ln"><span class="c1" id="c' + data[nindex].id + '"></span><span class="c2"></span></div>'
						+ '<div class="clear"></div>'
						+ '</div>'
						+ '<div class="list">'
						+ '<div id="newsMiddle' + data[nindex].id + '" class="l1">'
						+ '<ul id="midNews' + data[nindex].id + '"></ul>'
						+ '</div>'
						+ '</div>'
						+ '</div>'

					$("#centerNewsList").append(html)

					if (data[nindex].backgroundColor != null && data[nindex].backgroundColor != "") {
						background.setBackgroundAndOpacity($("#b" + data[nindex].id), data[nindex].backgroundColor, 1 - Number(data[nindex].backgroundOpacity));
					} else {
						background.setBackgroundAndOpacity($("#b" + data[nindex].id), "#ffffff", 0);
					}

					$("#l" + data[nindex].id).css({
						"font-size": data[nindex].fontSize,
						"font-weight": data[nindex].fontWeight,
						"font-style": data[nindex].fontStyle,
						"color": data[nindex].fontColor
					});

					if (data[nindex].isShowMore == false) {
						$("#r" + data[nindex].id).css("display", "none");
					}

					if (data[nindex].moreColor != null && data[nindex].moreColor != "") {
						$("#a" + data[nindex].id).css("color", data[nindex].moreColor);
					} else {
						$("#a" + data[nindex].id).css("color", "#8f8f8f");
					}

					if (data[nindex].lineColor != null && data[nindex].lineColor != "") {
						$("#c" + data[nindex].id).css("background", data[nindex].lineColor);
					} else {
						$("#c" + data[nindex].id).css("background", "#c30d23");
					}

					$("#a" + data[nindex].id).attr("href", "@Url.Action(nameof(MeetingNewsListController.Index), nameof(MeetingNewsListController).GetControllerName())" + "/" + data[nindex].id)
					$("#a" + data[nindex].id).attr("target", "_blank")
					$("#midNews" + data[nindex].id).html("")

					var n2_url = "@Url.Action(nameof(UtilityController.GetNews),
					nameof(UtilityController).GetControllerName())?id=" + "@Model.Id" + "&newslistId=" + data[nindex].id;
					$.get(n2_url, null, function (ndata, textStatus, jqXHR) {
						if (ndata.length > 0) {
							for (var j = 0; j < ndata.length; j++) {
								if (j <= 4) {
									var midNewsId = ndata[j].id
									//有图
									//图+标题+时间+摘要
									var ptda_html = '<li id="ptda_mid' + midNewsId + '" class="pic c1">'
									+ '<a id="ptda_midp' + midNewsId + '"><img src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + midNewsId + '" /><div class="l">'
									+ '<h3>' + ndata[j].newsTitle + '</h3>'
									+ '<h5 style="color:#b4b4b4">' + ndata[j].abstract + '</h5></div></a>'
									+ '<span class="t">' + ndata[j].createDate + '</span><div class="clear"></div></li>'

									//图+标题
									var pt_html = '<li id="pt_mid' + midNewsId + '" class="pic c1">'
									+ '<a id="pt_midp' + midNewsId + '"><img src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + midNewsId + '" />'
									+ '<span class="l">' + ndata[j].newsTitle + '</span></a>'
									+ '<span class="t"></span><div class="clear"></div></li>'

									//图
									var p_html = '<li id="p_mid' + midNewsId + '" >'
									+ '<a id="p_midp' + midNewsId + '"><img style="max-width: 620px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + midNewsId + '" />'
									+ '</a>'
									+ '</li>'

									//无图
									//标题+时间
									var tt_html = '<li id="tt_mid' + midNewsId + '" class="c1"><a id="tt_midp' + midNewsId + '"><span class="l">' + ndata[j].newsTitle + '</span></a><span class="t">' + ndata[j].createDate + '</span><div class="clear"></div></li>'

									//标题
									var t_html = '<li id="t_mid' + midNewsId + '" class="c1"><a id="t_midp' + midNewsId + '"><span class="l">' + ndata[j].newsTitle + '</span></a><span class="t"></span><div class="clear"></div></li>'

									//正文
									var s_html = '<li id="s_mid' + midNewsId + '"><span id="s_midp' + midNewsId + '">' + ndata[j].mainText + '</span></li>'

									var newsListID = ndata[j].newsListId

									var newsStyle = ndata[j].newsStyle

									if (newsStyle == "@ConstValues.NewsStyle.图标时摘") {
										$("#midNews" + newsListID).append(ptda_html)
										if (j % 2 != 0) {
											$("#ptda_mid" + midNewsId).removeClass("pic c1").addClass("pic")
										}

										$("#ptda_midp" + midNewsId).attr("href", ndata[j].link)
										$("#ptda_midp" + midNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图标") {
										$("#midNews" + newsListID).append(pt_html)
										if (j % 2 != 0) {
											$("#pt_mid" + midNewsId).removeClass("pic c1").addClass("pic")
										}

										$("#pt_midp" + midNewsId).attr("href", ndata[j].link)
										$("#pt_midp" + midNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图") {
										$("#newsMiddle" + newsListID).removeClass("l1").addClass("l4")
										$("#midNews" + newsListID).append(p_html)
										$("#p_midp" + midNewsId).attr("href", ndata[j].link)
										$("#p_midp" + midNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标时") {
										$("#midNews" + newsListID).append(tt_html)
										if (j % 2 != 0) {
											$("#tt_mid" + midNewsId).removeClass("c1")
										}

										$("#tt_midp" + midNewsId).attr("href", ndata[j].link)
										$("#tt_midp" + midNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标") {
										$("#midNews" + newsListID).append(t_html)
										if (j % 2 != 0) {
											$("#t_mid" + midNewsId).removeClass("c1")
										}

										$("#t_midp" + midNewsId).attr("href", ndata[j].link)
										$("#t_midp" + midNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.正文") {
										$("#newsMiddle" + newsListID).removeClass("l1").addClass("l3")
										$("#midNews" + newsListID).append(s_html)
									} else {
										console.log("newsStyle有问题")
									}
								}
							}
						}
					});
				}
			}
		});

		//NewsList Left
		$("#leftNewsList").html("")
		var l_url = "@Url.Action(nameof(MeetingMainController.GetLeftNewsList),
				nameof(MeetingMainController).GetControllerName())" + "/" + "@Model.Id";
		$.get(l_url, null, function (data, textStatus, jqXHR) {
			if (data.length > 0) {
				for (var l = 0; l < data.length; l++) {
					var lhtml = '<div class="box" id="b' + data[l].id + '">'
                    				+ '<div class="tit">'
						+ '<div class="ft">'
						+ '<div class="l" id="l' + data[l].id + '" style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;">' + data[l].newsListName + '</div>'
						+ '<div class="r" id="r' + data[l].id + '"><a id="a' + data[l].id + '">more&raquo;</a></div>'
						+ '</div>'
						+ '<div class="ln"><span class="c1" id="c' + data[l].id + '" ></span><span class="c2"></span></div>'
						+ '<div class="clear"></div>'
						+ '</div>'
						+ '<div id="llist' + data[l].id + '">'
						+ '<ul id="leftNews' + data[l].id + '">'
						+ '</ul>'
						+ '</div>'
						+ '</div>'

					$("#leftNewsList").append(lhtml)

					if (data[l].backgroundColor != null && data[l].backgroundColor != "") {
						background.setBackgroundAndOpacity($("#b" + data[l].id), data[l].backgroundColor, 1 - Number(data[l].backgroundOpacity));
					} else {
						background.setBackgroundAndOpacity($("#b" + data[l].id), "#ffffff", 0);
					}

					$("#l" + data[l].id).css({
						"font-size": data[l].fontSize,
						"font-weight": data[l].fontWeight,
						"font-style": data[l].fontStyle,
						"color": data[l].fontColor
					});

					if (data[l].isShowMore == false) {
						$("#r" + data[l].id).css("display", "none");
					}

					if (data[l].moreColor != null && data[l].moreColor != "") {
						$("#a" + data[l].id).css("color", data[l].moreColor);
					} else {
						$("#a" + data[l].id).css("color", "#8f8f8f");
					}

					if (data[l].lineColor != null && data[l].lineColor != "") {
						$("#c" + data[l].id).css("background", data[l].lineColor);
					} else {
						$("#c" + data[l].id).css("background", "#c30d23");
					}

					$("#a" + data[l].id).attr("href", "@Url.Action(nameof(MeetingNewsListController.Index), nameof(MeetingNewsListController).GetControllerName())" + "/" + data[l].id)
					$("#a" + data[l].id).attr("target", "_blank")

					$("#leftNews" + data[l].id).html("")

					var ln_url = "@Url.Action(nameof(UtilityController.GetNews),
							nameof(UtilityController).GetControllerName())?id=" + "@Model.Id" + "&newslistId=" + data[l].id;
					$.get(ln_url, null, function (ldata, textStatus, jqXHR) {
						if (ldata.length > 0) {
							for (var q = 0; q < ldata.length; q++) {
								if (q <= 4) {
									var leftNewsId = ldata[q].id;
									var leftNewsListId = ldata[q].newsListId;

									//图+标题+时间+摘要
									var ptad_leftHtml = '<li><a id="ptad_left' + leftNewsId + '">'
									+ '<p><img style="width:176px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + leftNewsId + '" /></p>'
									+ '<p >' + ldata[q].newsTitle + '</p>'
									+ '<p>' + ldata[q].abstract + '</p>'
									+ '<p style="color:#b4b4b4">' + ldata[q].createDate + '</p>'
									+ '</a></li>'

									//图+标题
									var pt_leftHtml = '<li><a id="pt_left' + leftNewsId + '">'
									+ '<p><img style="width:176px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + leftNewsId + '" /></p>'
									+ '<p>' + ldata[q].newsTitle + '</p>'
									+ '</a></li>'

									//图
									var p_leftHtml = '<li><a id="p_left' + leftNewsId + '">'
									+ '<p><img style="width:176px" src="' + "@Url.Action(nameof(UtilityController.NewsSimpleImg), nameof(UtilityController).GetControllerName())?id=" + leftNewsId + '" /></p>'
									+ '</a></li>'

									//标题+时间
									var tt_leftHtml = '<li><a id="tt_left' + leftNewsId + '">' + ldata[q].newsTitle + '<span style="float:right;color:#b4b4b4">' + ldata[q].createDate + '</span></a></li>'

									//标题
									var t_leftHtml = '<li><a id="t_left' + leftNewsId + '">' + ldata[q].newsTitle + '</a></li>'

									//正文
									var s_leftHtml = '<li><span id="s_left' + leftNewsId + '" style="word-break:break-all; width:150px;">' + ldata[q].mainText + '</span></li>'

									var newsStyle = ldata[q].newsStyle

									if (newsStyle == "@ConstValues.NewsStyle.图标时摘") {
										$("#leftNews" + leftNewsListId).append(ptad_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt02")
										$("#ptad_left" + leftNewsId).attr("href", ldata[q].link)
										$("#ptad_left" + leftNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图标") {
										$("#leftNews" + leftNewsListId).append(pt_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt02")
										$("#pt_left" + leftNewsId).attr("href", ldata[q].link)
										$("#pt_left" + leftNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.图") {
										$("#leftNews" + leftNewsListId).append(p_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt02")
										$("#p_left" + leftNewsId).attr("href", ldata[q].link)
										$("#p_left" + leftNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标时") {
										$("#leftNews" + leftNewsListId).append(tt_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt")
										$("#tt_left" + leftNewsId).attr("href", ldata[q].link)
										$("#tt_left" + leftNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.标") {
										$("#leftNews" + leftNewsListId).append(t_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt")
										$("#t_left" + leftNewsId).attr("href", ldata[q].link)
										$("#t_left" + leftNewsId).attr("target", "_blank")
									} else if (newsStyle == "@ConstValues.NewsStyle.正文") {
										$("#leftNews" + leftNewsListId).append(s_leftHtml)
										$("#llist" + leftNewsListId).addClass("txt03")
									} else {
										console.log("newsStyle有问题")
									}
								}
							}
						}
					});
				}
			}
		});

		@if (!string.IsNullOrEmpty(Model.PicForBackgroundPath)) {
			<text>
			background.setBackgroundAndOpacity($("#divImg"), "#ffffff", Number("@Model.OpacityOfPic"));
			$(".container").css({
				"background-image": "url(@Model.PicForBackgroundPath)",
				"background-size": "100% auto",
				"background-repeat": "repeat-y",
				"background-position": "top center",
				"background-attachment": "@Model.IsFollowBackground" == "True" ? "fixed" : "scroll",
			});
			</text>
		} else if (!string.IsNullOrEmpty(Model.ColorForBackground)) {
			<text>
			background.setBackgroundAndOpacity($(".container"), "@Model.ColorForBackground", 1 - Number("@Model.OpacityOfColor"));
			</text>
		}

		@if (!string.IsNullOrEmpty(Model.ColorForMenu)) {
			<text>
			background.setBackgroundAndOpacity($(".top"), "@Model.ColorForMenu", 1 - Number("@Model.OpacityOfMenu"));
			</text>
		} else {
			<text>
			background.setBackgroundAndOpacity($(".top"), "#4c4948", 1 - Number("@Model.OpacityOfMenu"));
			</text>
		}

		@if (!string.IsNullOrEmpty(Model.ColorForLeft)) {
			<text>
			background.setBackgroundAndOpacity($(".lbox"), "@Model.ColorForLeft", 1 - Number("@Model.OpacityOfLeft"));
			</text>
		} else {
			<text>
			background.setBackgroundAndOpacity($(".lbox"), "#ffffff", 1 - Number("@Model.OpacityOfLeft"));
			</text>
		}

		@if (!string.IsNullOrEmpty(Model.ColorForCenter)) {
			<text>
			background.setBackgroundAndOpacity($(".mbox"), "@Model.ColorForCenter", 1 - Number("@Model.OpacityOfCenter"));
			</text>
		} else {
			<text>
			background.setBackgroundAndOpacity($(".mbox"), "#ffffff", 1 - Number("@Model.OpacityOfCenter"));
			</text>
		}

		@if (!string.IsNullOrEmpty(Model.ColorForRight)) {
			<text>
			background.setBackgroundAndOpacity($(".rbox"), "@Model.ColorForRight", 1 - Number("@Model.OpacityOfRight"));
			</text>
		} else {
			<text>
			background.setBackgroundAndOpacity($(".rbox"), "#ffffff", 1 - Number("@Model.OpacityOfRight"));
			</text>
		}
	});

	window.onresize = function () {
		background.setOnResize();
	}
</script>

<div style="position:relative;z-index:999;width:100%;">
	<!-- banner start -->
	<div class="banner">
		<img id="titleBanner" src="@Url.Action(nameof(UtilityController.ConferenceBannerImg), nameof(UtilityController).GetControllerName())?id=@Model.Id" />
		<div class="mar"><div class="time" id="m-time"></div></div>
	</div>
	<!-- banner end -->
	<div class="container">
		<div id="divImg">
			<!-- menu start -->
			<div class="top">
				<div class="main">
					<div class="nav_bar">
						<ul id="m-menu"></ul>
					</div>
				</div>
			</div>
			<!-- menu end -->
			<div class="mar">
				<div class="tem01">
					<!-- left start -->
					<div class="lbox fl" id="leftNewsList"></div>
					<!-- left end -->
					<!-- middle start -->
					<div class="mbox fl" style="margin-left:7px;">
						<div class="c">
							<!-- slide -->
							@if (Model.MeetingSliderList.Count() > 0) {
								<div class="slide fl">
									<div id="focus">
										<ul id="meetingbanner">
											@if (Model.MeetingSliderList.Count() > 0) {
												for (int index = 0; index < Model.MeetingSliderList.Count(); index++) {
													if (index <= 4) {
														if (!string.IsNullOrEmpty(Model.MeetingSliderList[index].Link)) {
															<li>
																<a href="@Model.MeetingSliderList[index].Link" target="_blank">
																	<img src="@Url.Action(nameof(UtilityController.BannerImg), nameof(UtilityController).GetControllerName())?id=@Model.MeetingSliderList[index].Id" alt="" />
																</a>
																<a href="#" class="tit">@Model.MeetingSliderList[index].Title</a>
															</li>
														} else {
															<li>
																<a>
																	<img src="@Url.Action(nameof(UtilityController.BannerImg), nameof(UtilityController).GetControllerName())?id=@Model.MeetingSliderList[index].Id" alt="" />
																</a>
																<a href="#" class="tit">@Model.MeetingSliderList[index].Title</a>
															</li>
														}
													}
												}
											}
										</ul>
									</div>
								</div>
							}
							<!-- slide end -->
							<!-- about start -->
							@if (!string.IsNullOrEmpty(Model.Introduction)) {
								<div class="box fl"  id="bConference">
									<div class="tit">
										<div class="ft">
											<div class="l" id="lConference">@Resources.ConferenceIntroduction</div>
											<div class="r" id="rConference"></div>
										</div>
										<div class="ln"><span class="c1" id="cConference"></span><span class="c2"></span></div>
										<div class="clear"></div>
									</div>
									<div class="txt">
										<div class="f">
											@Html.Raw(Model.Introduction.Replace("\"", "'"))
										</div>
									</div>
								</div>
							}
							<!-- about end -->
							<!-- list start -->
							<div id="centerNewsList"></div>
							<!-- list end -->
							<div class="clear"></div>
						</div>
					</div>
					<!-- middle end -->
					<!-- right start -->
					<div class="rbox fr">
						<!-- button start -->
						<div class="button">
							<input type="button" id="m-cButton" value="@Resources.MeetingContribute" />
							<input type="button" id="m-rButton" value="@Resources.MeetingAttendence" />
							<input type="button" id="m-hButton" />
						</div>
						<!-- button end -->
						<!-- colomn start -->
						<div id="rightNewsList"></div>
						<!-- colomn end -->
					</div>
					<!-- right end -->
					<div class="clear"></div>
				</div>
			</div>
			<!-- footer start -->
			<div class="footer">
				<p>&copy;@Resources.CopyRightOfCisSystem</p>
				<p id="CopyRightId" style="margin-top:-70px">
					<a href="@Resources.CopyRightOfCisSystemLinkOne" target="_blank" style="color:#999">@Resources.CopyRightOfCisSystemOne &nbsp;&nbsp;</a>
					<a href="@Resources.CopyRightOfCisSystemLinkTwo" target="_blank" style="color:#999"><img src="~/Images/police.png" style="position:relative; top:4px;" />@Resources.CopyRightOfCisSystemTwo</a>
				</p>
			</div>
			<!-- footer end -->
		</div>
	</div>
</div>